/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bean;

import controller.ReportsOfUser;
import entities.Report;
import java.util.List;
import javax.faces.application.Application;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;

/**
 *
 * @author QUY-THI
 */
@ManagedBean
@SessionScoped
public class ReportOfUserBean {

    private List<Report> res;

    public List<Report> getRes() {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        Application app = facesContext.getApplication();
        LoginBean lg = (LoginBean) app.createValueBinding("#{loginBean}").getValue(facesContext);
        ReportsOfUser ro = new ReportsOfUser();
        return ro.reportsOfUser(lg.getUser().getUserID());
    }

    public void setRes(List<Report> res) {
        this.res = res;
    }

    /**
     * Creates a new instance of ReportOfUserBean
     */
    public ReportOfUserBean() {
    }
}
